<div class="fly-header layui-bg-black">
  <div class="layui-container">
    <a class="fly-logo" style="top:0px;" href="/">
      <img height="50" src="/static/bbs/images/logo.png" alt="layui">
    </a>
    <ul class="layui-nav fly-nav layui-hide-xs">
      <?php
      $_nav1 = $this->db->cache('select * from nav where cat_id =?',[1]);
      foreach($_nav1 as $v):?>
      <li class="layui-nav-item <?=($_SERVER['REQUEST_URI']==$v['url'])?'layui-this':'';?>"><a href="<?=$v['url']?>"><i class="iconfont <?=$v['ico']?>"></i><?=$v['title']?></a></li>
      <?php endforeach;?>
    </ul>

    <ul class="layui-nav fly-nav-user">
      <?php if(!$userinfo):?>
      <!-- 未登入的状态 -->
      <li class="layui-nav-item">
        <a class="iconfont icon-touxiang layui-hide-xs" href="<?=url('publics/login')?>"></a>
      </li>
      <li class="layui-nav-item">
        <a href="<?=url('publics/login')?>">微信扫码登入</a>
      </li>
      <!-- <li class="layui-nav-item">
        <a href="<?=url('publics/register')?>">注册</a>
      </li>
      <li class="layui-nav-item layui-hide-xs">
        <a href="<?=url('qq/login')?>" onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})" title="QQ登入" class="iconfont icon-qq"></a>
      </li>
      <li class="layui-nav-item layui-hide-xs">
        <a href="<?=url('api/weibo')?>" onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})" title="微博登入" class="iconfont icon-weibo"></a>
      </li> -->
  <?php else:?>
      <!-- 登入后的状态 -->
      <li class="layui-nav-item">
        <a class="fly-nav-avatar" href="javascript:;">
          <cite class="layui-hide-xs"><?=$userinfo['username']?></cite>
          <?php if($userinfo['is_rz']):?>
          <i class="iconfont icon-renzheng layui-hide-xs" title="认证信息：<?=$userinfo['username']?>"></i>
          <?php endif;?>
          <?php if($userinfo['level']):?>
          <i class="layui-badge fly-badge-vip layui-hide-xs">VIP<?=$userinfo['level']?></i>
          <?php endif;?>
          <img src="<?=$userinfo['pic']?$userinfo['pic']:'/static/bbs/images/avatar/default.png'?>">
        </a>
        <dl class="layui-nav-child">
          <dd><a href="<?=url('user/index',['id'=>$userinfo['id']])?>"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;">&#xe68e;</i>我的主页</a></dd>
          <dd><a href="<?=url('user/tie')?>"><i class="layui-icon">&#xe60a;</i>我的帖子</a></dd>
          <dd><a href="<?=url('user/set')?>"><i class="layui-icon">&#xe620;</i>基本设置</a></dd>
          <?php if($userinfo['is_team']==1):?>
          <dd><a href="<?=url('xiangmu/admin/index')?>"><i class="layui-icon">&#xe770;</i>项目管理</a></dd>
          <?php endif;?>
          <hr style="margin: 5px 0;">
          <dd><a href="<?=url('publics/logout')?>" style="text-align: center;">退出</a></dd>
        </dl>
      </li>
  <?php endif;?>
    </ul>
  </div>
</div>
